/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.prerecitran.entity;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.modules.base.entity.customer.Customer;
import com.jeesite.modules.order.entity.serviceorder.ServiceOrder;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 预收转账单Entity
 * @author wsm
 * @version 2021-03-24
 */
@Table(name="t_advances_received_transfer", alias="a", columns={
		@Column(name="advances_received_transfer_id", attrName="advancesReceivedTransferId", label="预收转账单ID", isPK=true),
		@Column(name="advances_received_transfer_code", attrName="advancesReceivedTransferCode", label="编号", queryType=QueryType.LIKE),
		@Column(name="advances_received_code", attrName="advancesReceivedCode", label="原预收款编号"),
		@Column(name="customer_id", attrName="customerId", label="客户"),
		@Column(name="bill_status", attrName="billStatus", label="审批状态"),
		@Column(name="status1", attrName="status1", label="单据状态"),
		@Column(name="service_order_id", attrName="serviceOrderId", label="服务订单"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
	},joinTable = {
		@JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = Customer.class, attrName = "customer", alias = "b",
				on = "b.customer_id = a.customer_id", columns = {
				@Column(name = "customer_id", label = "客户编号", isPK = true),
				@Column(name = "customer_name", label = "客户名称"),
		})
}, orderBy="a.update_date DESC"
)
public class TadvancesReceivedTransfer extends DataEntity<TadvancesReceivedTransfer> {
	
	private static final long serialVersionUID = 1L;
	private String advancesReceivedTransferId;		// 预收转账单ID
	private String advancesReceivedTransferCode;		// 编号
	private String advancesReceivedCode;		// 原预收款编号
	private String customerId;		// 客户
	private String serviceOrderId;		// 服务订单
	private Customer customer;
	private String billStatus;
	private String status1;
	private List<TadvancesReceivedTransferDetail> tadvancesReceivedTransferDetailList = ListUtils.newArrayList();		// 子表列表

	public String getStatus1() {
		return status1;
	}

	public void setStatus1(String status1) {
		this.status1 = status1;
	}

	public String getBillStatus() {
		return billStatus;
	}

	public void setBillStatus(String billStatus) {
		this.billStatus = billStatus;
	}

	public TadvancesReceivedTransfer() {
		this(null);
	}

	public TadvancesReceivedTransfer(String id){
		super(id);
	}
	
	public String getAdvancesReceivedTransferId() {
		return advancesReceivedTransferId;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public void setAdvancesReceivedTransferId(String advancesReceivedTransferId) {
		this.advancesReceivedTransferId = advancesReceivedTransferId;
	}
	
	@Length(min=0, max=100, message="编号长度不能超过 100 个字符")
	public String getAdvancesReceivedTransferCode() {
		return advancesReceivedTransferCode;
	}

	public void setAdvancesReceivedTransferCode(String advancesReceivedTransferCode) {
		this.advancesReceivedTransferCode = advancesReceivedTransferCode;
	}
	
	@Length(min=0, max=100, message="原预收款编号长度不能超过 100 个字符")
	public String getAdvancesReceivedCode() {
		return advancesReceivedCode;
	}

	public void setAdvancesReceivedCode(String advancesReceivedCode) {
		this.advancesReceivedCode = advancesReceivedCode;
	}
	
	@NotBlank(message="客户不能为空")
	@Length(min=0, max=64, message="客户长度不能超过 64 个字符")
	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	

	@Length(min=0, max=64, message="服务订单长度不能超过 64 个字符")
	public String getServiceOrderId() {
		return serviceOrderId;
	}

	public void setServiceOrderId(String serviceOrderId) {
		this.serviceOrderId = serviceOrderId;
	}
	
	public List<TadvancesReceivedTransferDetail> getTadvancesReceivedTransferDetailList() {
		return tadvancesReceivedTransferDetailList;
	}

	public void setTadvancesReceivedTransferDetailList(List<TadvancesReceivedTransferDetail> tadvancesReceivedTransferDetailList) {
		this.tadvancesReceivedTransferDetailList = tadvancesReceivedTransferDetailList;
	}
	
}